package com.sky.loveshop.mapper;

import com.sky.loveshop.entity.User;
import com.sky.loveshop.entity.qo.UserQO;
import com.sky.loveshop.entity.vo.UserVO;
import com.sky.loveshop.utils.MyMapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

public interface UserMapper extends MyMapper<User> {

    List<UserVO> searchAll(UserQO qo);

    User getUserById(@Param("id") Integer id);

    List<User> getUserListByIds(@Param("ids") List<Integer> ids);

    Integer delUserById(@Param("id") Integer id);

    Integer updateUserById(User user);

    Integer insertOne(User user);

    User login(User user);

    Integer deducePoints(@Param("userId") Integer userId, @Param("totalAmount") BigDecimal totalAmount);
}